//Popup action
function ctrlInitArrowDialogAction(context, selector){
	var win = window;//tmt.jquery.modalframe.getOpener();
	$(".ctrl-action-type-dialog", context).click( function(){
		
		var tempReloadHadler = win.Page.reloadHandler;
		var rel = $(this).attr("rel");
		
		var settings = {};
		settings.url = $(this).attr("href");
		if( rel && rel.indexOf("|")!= -1 ){
			var tmp = rel.split("|");
			settings.width = parseInt( tmp[0]);
			settings.height = parseInt(tmp[1]);
			
			if(settings.width == -1 && settings.height ==-1){
				settings.width = $(window).width() - 20;
				settings.height = $(window).height() - 60;
			}

			if(tmp[2] != ""){
				win.Page.reloadHandler = function(force){  CtrlAjax.reload(tmp[2])};
				settings.onClose = function(elts, settings){
					win.Page.reloadHandler = tempReloadHadler;
				};
			}
		}
		
		try{
			tmt.jquery.modalframe.open($(this).attr("href")+"&iframe=1", settings);
		}catch(ex){
			alert("Bład otwierania okna: " + ex);
			window.location.reload();
		}
		/*		
		if( $(this).attr("target") == "_blank" ){
			settings.forceType = "iframe";
		}else{
			settings.endShowContent = function(elts, settings){
				win.Page.parseHtml(elts.content);
			};
		}
		
		$.nyroModalManual(settings);
		
		*/
		return false;
	});
	
}